package com.nextwist.interfaces;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import com.nexttwist.pojo.User;

/**
 * This interface is used to expose the methods related to user
 * @author Mintu
 *
 */
@Path("/")	
public interface IUserInterface {
	
	/**
	 * This method is used to find the Stories created by the particular user
	 * @param userId
	 * @param pageNo
	 * @param limit
	 * @return JsonArray
	 */
	@GET
	@Path("stories")
	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	public Response userSpecificStory(@QueryParam("userId") int userId, @QueryParam("pageNo") int pageNo, @QueryParam("limit") int limit);
	
	/**
	 * This method is used to find the list of followers
	 * @param userId
	 * @param pageNo
	 * @param limit
	 * @return JsonArray
	 */
	@GET
	@Path("followers")
	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	public Response userFollowers(@QueryParam("userId") int userId, @QueryParam("pageNo") int pageNo, @QueryParam("limit") int limit);
	
	/**
	 * This method is used to find the list of followings
	 * @param userId
	 * @param pageNo
	 * @param limit
	 * @return JsonArray
	 */
	@GET
	@Path("followings")
	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	public Response userFollowings(@QueryParam("userId") int userId, @QueryParam("pageNo") int pageNo, @QueryParam("limit") int limit);
	
	/**
	 * This method is used to follow frnd
	 * @param followerId
	 * @param followingId
	 * @return boolean
	 */
	@GET
	@Path("follow")
	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	public Response userFollow(@QueryParam("followerId") int followerId, @QueryParam("followingId") int followingId);
	
	/**
	 * This method is used to add user
	 * @param userObject
	 * @return
	 */
	@POST
	@Path("user")
	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	@Consumes({MediaType.APPLICATION_JSON})
	public Response addUser(User userObject);
	
	/**
	 * This method is used to update user
	 * @param userObject
	 * @return
	 */
	@PUT
	@Path("user")
	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	@Consumes({MediaType.APPLICATION_JSON})
	public Response updateUser(User userObject);
	
	/**
	 * This method is user to get the user details
	 * @param userId
	 * @return
	 */
	@GET
	@Path("user")
	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	public Response userDetails(@QueryParam("userId") int userId);
	
	/**
	 * This method is used to change password
	 * @param userId
	 * @param oldPass
	 * @param newPass
	 * @return
	 */
	@GET
	@Path("changePassword")
	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	public Response changePassword(@QueryParam("userId") int userId, @QueryParam("oldPass") String oldPass, @QueryParam("newPass") String newPass);
	
	/**
	 * This method is used to login
	 * @param emailId
	 * @param password
	 * @return
	 */
	@GET
	@Path("userLogin")
	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	public Response userLogin(@QueryParam("emailId") String emailId, @QueryParam("password") String password);
	
}
